package com.xxatom.ha.common.retry;

import com.xxatom.ha.common.retry.RetryCounter.RetryConfig;

/**
 * Factory to create {@link RetryCounter} use designated {@link RetryConfig} or default
 * configuration.
 *
 * @author Alex
 */
public class RetryCounterFactory {

  private final RetryConfig retryConfig;

  public RetryCounterFactory() {
    this.retryConfig = new RetryConfig();
  }

  public RetryCounterFactory(final RetryConfig retryConfig) {
    this.retryConfig = retryConfig;
  }

  public RetryCounter create() {
    return new RetryCounter(retryConfig);
  }

}
